package com.yym.ssh;


import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

public class JettyConsole {

	public static final int PORT = 8089;
	public static final String CONTEXT = "/ssh";

	public static void main(String[] args) throws Exception {

		Server server = new Server(PORT);
		WebAppContext webContext = new WebAppContext("src/main/webapp", CONTEXT);

		// webContext.setDefaultsDescriptor("src/test/resources/webdefault.xml");
		webContext.setClassLoader(Thread.currentThread()
				.getContextClassLoader());
		server.setHandler(webContext);

		server.setStopAtShutdown(true);

		server.start();

		System.out.println("hit Enter in console to stop Server");

		if (System.in.read() != 0) {

			server.stop();
			System.out.println("Server stopped");
		}

	}
}
